#ifndef LOCALINFO_H
#define LOCALINFO_H

#include <QObject>
#include <QProcess>
struct LocalInfoStruct
{
    QString serviceKey;
    QString cpuInfo;
    QString hardDiskInfo;
    QString installHardDiskInfo;
    QString disPlayCardInfo;
    QString netCardInfo;
    QString macInfo;
    QByteArray lspciInfo;
    QByteArray dpkgInfo;
};


class LocalInfo : public QObject
{
    Q_OBJECT
public:
    explicit LocalInfo(QObject *parent = nullptr);
    ~LocalInfo();
    void getLocalInfo();
    static LocalInfoStruct getHandledLocalInfo();
    bool getReady();
    void getAllInfoIntialized();
signals:
private slots:

    void readDisPlayCardInfo();
    void readNetCardInfo();
    void readlspciInfo();
    void readdpkgInfo();
private:
    static LocalInfoStruct sm_localInfoStruct;

    QProcess *localInfoProcess = nullptr;

    int numOfDisk = 0;
    int numOfDisplayCard = 0;

    void getServiceKey();
    void getCpuInfo();
    void getHardDiskInfo();
    void getDisPlayCardInfo();
    void getNetCardInfo();
    void getMACInfo();
    void getlspciInfo();
    void getdpkgInfo();
    static bool readyFlag;
    static bool cpuInfoReadyFlag;
    static bool hardDiskInfoReadyFlag;
    static bool displayCardInfoReadyFlag;
    static bool netCardInfoReadyFlag;
    static bool macInfoReadyFlag;
    static bool lspciInfoReadyFlag;
    static bool dpkgInfoReadyFlag;
};

#endif // LOCALINFO_H
